package com.ego.ware.po;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.ego.common.constant.WareConstant;
import lombok.Data;

/**
 * @program: ego
 * @description 库存工作单
 * @author KamTang
 * @date 2022-11-13 13:30:29
 */
@Data
@TableName("wms_ware_order_task_detail")
public class WareOrderTaskDetail implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	private Long id;
	/**
	 * sku_id
	 */
	private Long skuId;
	/**
	 * sku_name
	 */
	private String skuName;
	/**
	 * 购买个数
	 */
	private Integer skuNum;
	/**
	 * 工作单id
	 */
	private Long taskId;
	/**
	 * 仓库id
	 */
	private Long wareId;
	/**
	 * 1-已锁定  2-已解锁  3-扣减
	 */
	private Integer lockStatus;

	/**
	 * 解锁状态
	 */
	public void unlock() {
		this.setLockStatus(WareConstant.WareOrderTaskLockStatusEnum.UNLOCK.getCode());
	}

	/**
	 * 可解锁的
	 */
	public boolean lockable() {
		return this.lockStatus == WareConstant.WareOrderTaskLockStatusEnum.LOCKED.getCode();
	}
}
